package com.wunu.smartlock1.net.response;

import com.google.gson.annotations.SerializedName;

public class ApiLoginResponse implements ApiResponse<LoginResult> {
    private LoginResult data;
    private int code;
    /*
    @SerializedName("error")
    private String errorMsg;
*/
    public LoginResult getData() {
        return data;
    }

    public void setData(LoginResult data) {
        this.data = data;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }
/*
    public String getErrorMsg() {
        return errorMsg;
    }

    public void setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
    }
*/
    public boolean ok(){
        return data!=null && data.getCode() == 200;
    }

    @Override
    public String toString() {
        return "code:"+code+"\tdata:"+data;
    }
}
